/*
 * 
 */
 
Ext.namespace('Ext.ux');

Ext.ux.CButton = Ext.extend(Ext.Button, {
	toolbar : false,
	
	codeFormPanelId : true,
	
	cmdName : true,
	
	width: 30,
	
	initComponent : function(){
		Ext.ux.CButton.superclass.initComponent.call(this);
	},
	
	afterRender : function(){
       Ext.ux.CButton.superclass.afterRender.call(this);
    },
	
	save : function() {
		var code = Ext.getCmp(this.codeFormPanelId).get(0).getCode();
	},
	
	undo : function() {
        var code = Ext.getCmp(this.codeFormPanelId).get(0).undo();
	},
	
	redo : function() {
        var code = Ext.getCmp(this.codeFormPanelId).get(0).redo();
	},
	
	listeners : {
        click : function() {
        	if (this.cmdName == 'save') {
        		this.save();
        	} else if (this.cmdName == 'undo') {
        		this.undo();
        	} else if (this.cmdName == 'redo') {
        		this.redo();
        	}
        }
    }
});